/*
 * @Author: Meow
 * @Date: 2019-10-11 11:04:11
 * @LastEditors: Civet
 * @LastEditTime: 2019-11-01 10:24:33
 * @Description: 组织机构档案
 */
import https from "../http";
import qs from "qs";

const WSB_API = process.env.NODE_ENV == "development" ? "/wsbUrl" : `${process.env.JZT_API}`;

const institutionalFileApi = {
  //  组织机构档案-树数据
  treeData: function (query) {
    return https({
      url: `${WSB_API}/catalog/findOrgCatalogTree`,
      method: 'get',
      headers: {
        sendKey: "treeData"
      },
      params: query
    })
  },
  //  组织机构档案-弹出层-上级目录列表
  findCatalogList: function (query) {
    return https({
      url: `${WSB_API}/catalog/findOrgCatalogList`,
      method: 'get',
      headers: {
        sendKey: "treeData"
      },
      params: query
    })
  },
  //  组织机构档案-弹出层-目录类型列表
  // institutionalFileApi.queryDictInfoByType = function (query) {
  //   return https({
  //     url: `${WSB_API}/dict/queryDictInfoByType`,
  //     method: 'get',
  //     headers: {
  //       sendKey: "treeData"
  //     },
  //     params: query
  //   })
  // }
  //  组织机构档案-弹出层-新增目录接口  params [parentId,catalogName,catalogType]
  addCatalog: function (query) {
    return https({
      url: `${WSB_API}/catalog/addCatalog`,
      method: 'get',
      headers: {
        sendKey: "treeData"
      },
      params: query
    })
  },
  //  组织机构档案-弹出层-删除目录接口  params {catalogId}
  deleteCatalogById: function (query) {
    return https({
      url: `${WSB_API}/catalog/deleteCatalogById`,
      method: 'get',
      headers: {
        sendKey: "treeData"
      },
      params: query
    })
  }
};



export default institutionalFileApi
